/**
 * @program: LeetCode
 * @description: LeetCode :
 * @author: WXY
 * @create: 2023-01-02 14:55
 * @Version 1.0
 **/
public class num383_canConstruct {
    public static boolean canConstruct(String ransonNodte, String magezine) {
        int[] arr = new int[26];
        for (char ch : magezine.toCharArray()) {
            arr[ch - 'a']++;
        }
        for (char ch : ransonNodte.toCharArray()) {
            arr[ch - 'a']--;
            if (arr[ch - 'a'] < 0) {
                return false;
            }
        }
        return true;
    }
}
